﻿<sap:ActivityDesigner x:Class="Vision.Core.ActivityComponents.Sql.SqlExecuteReportDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:sqlcleint="clr-namespace:System.Data.SqlClient;assembly=System.Data"
    xmlns:custom="clr-namespace:Vision.Core.ActivityComponents.Common"                      
    Collapsible="True" Icon="{DynamicResource DesignerIcon}">
    <sap:ActivityDesigner.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <sapc:ArgumentToExpressionConverter x:Key="argumentToExpressionConverter" />
            <DataTemplate x:Uid="DataTemplate_1" x:Key="ExpandedFileSaveTemplate">
                <StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="22"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                            <RowDefinition Height="24" />
                        </Grid.RowDefinitions>

                        <!-- Inputs Header -->
                        <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Text="Input(s):" FontWeight="Bold" Foreground="Navy" Margin="0,0,0,3" />

                        <!-- ModelItem.ReportServerUrl -->
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="ServerUrl:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="1"  MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.ReportServerUrl, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                                ExpressionType="{Binding Path=ModelItem.ReportServerUrl.ArgumentType}"
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                        <custom:TypeBrowserButton  Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.ReportServerUrl.ArgumentType}"/>

                        <!-- ModelItem.ReportPath -->
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Path:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="2" Grid.Column="1"  MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.ReportPath, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                                ExpressionType="{Binding Path=ModelItem.ReportPath.ArgumentType}"
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                        <custom:TypeBrowserButton  Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.ReportPath.ArgumentType}"/>

                        <!-- ModelItem.ReportParameters -->
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Parameters:" VerticalAlignment="Center" />
                        <sapv:ExpressionTextBox Grid.Row="3" Grid.Column="1"  MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                Expression="{Binding Path=ModelItem.ReportParameters, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                                ExpressionType="{Binding Path=ModelItem.ReportParameters.ArgumentType}"
                                OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                        <custom:TypeBrowserButton  Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.ReportParameters.ArgumentType}"/>
                    </Grid>
                    <Border BorderThickness="0,0,0,3" Margin="0,5">
                        <Border.BorderBrush>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="DarkGray" Offset="0" />
                                <GradientStop Color="White" Offset="1" />
                            </LinearGradientBrush>
                        </Border.BorderBrush>
                    </Border>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="22"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Text="Body Argument:" Foreground="Gray"/>
                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=ModelItem.Body.Argument.Name, Mode=TwoWay}" Margin="7,0,0,0" Foreground="Gray" VerticalAlignment="Center"/>
                        <custom:TypeBrowserButton  Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" BrowserType="{Binding Path=ModelItem.Body.Argument.Type}"/>
                    </Grid>
                    <!-- Body -->
                    <sap:WorkflowItemPresenter x:Uid="sad:WorkflowItemPresenter_1" AutomationProperties.AutomationId="Activity" IsDefaultContainer="True" HintText="Drop activity here" Item="{Binding Path=ModelItem.Body.Handler, Mode=TwoWay}" AllowedItemType="{x:Type sa:Activity}" MinWidth="100" MinHeight="100" Margin="0,7,0,0"/>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Uid="DataTemplate_2" x:Key="CollapsedActivityViewTemplate">
                <Label x:Uid="TextBlock_6" Padding="0,0,0,0" FontStyle="Italic" Foreground="{x:Static SystemColors.GrayTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">Double-click to view</Label>
            </DataTemplate>
            <Style x:Uid="Style_1" x:Key="DesignerStyle" TargetType="{x:Type ContentPresenter}">
                <Setter x:Uid="Setter_1" Property="ContentTemplate" Value="{DynamicResource CollapsedActivityViewTemplate}" />
                <Style.Triggers>
                    <DataTrigger x:Uid="DataTrigger_1" Binding="{Binding Path=ShowExpanded}" Value="true">
                        <Setter x:Uid="Setter_2" Property="ContentTemplate" Value="{DynamicResource ExpandedFileSaveTemplate}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <DrawingBrush x:Key="DesignerIcon" Stretch="Uniform">
                <DrawingBrush.Drawing>
                    <DrawingGroup x:Uid="DrawingGroup_29">
                        <DrawingGroup.Children>
                            <GeometryDrawing x:Uid="GeometryDrawing_62" Brush="#FF30A3C6" Geometry="F1 M 138.847,178.101 L 146.667,178.101 C 147.315,178.101 147.84,178.576 147.84,179.162 L 147.84,184.319 C 147.84,184.905 147.315,185.38 146.667,185.38 L 138.847,185.38 C 138.199,185.38 137.674,184.905 137.674,184.319 L 137.674,179.162 C 137.674,178.576 138.199,178.101 138.847,178.101 M 138.521,186.573 L 146.993,186.573 C 147.461,186.573 147.84,186.952 147.84,187.42 147.84,187.889 147.461,188.268 146.993,188.268 L 138.521,188.268 C 138.053,188.268 137.674,187.889 137.674,187.42 137.674,186.952 138.053,186.573 138.521,186.573 M 133.444,192.5 L 152.111,192.5 C 152.847,192.5 153.444,193.097 153.444,193.833 L 153.444,194.722 C 153.444,195.459 152.847,196.056 152.111,196.056 L 133.444,196.056 C 132.708,196.056 132.111,195.459 132.111,194.722 L 132.111,193.833 C 132.111,193.097 132.708,192.5 133.444,192.5 M 133.444,174.722 L 152.111,174.722 C 152.847,174.722 153.444,175.319 153.444,176.056 L 153.444,190.278 C 153.444,191.014 152.847,191.611 152.111,191.611 L 133.444,191.611 C 132.708,191.611 132.111,191.014 132.111,190.278 L 132.111,176.056 C 132.111,175.319 132.708,174.722 133.444,174.722 M 135.411,176.572 C 134.693,176.572 134.111,177.154 134.111,177.872 L 134.111,188.461 C 134.111,189.179 134.693,189.761 135.411,189.761 L 150.144,189.761 C 150.862,189.761 151.444,189.179 151.444,188.461 L 151.444,177.872 C 151.444,177.154 150.862,176.572 150.144,176.572 L 135.411,176.572 Z" />
                        </DrawingGroup.Children>
                    </DrawingGroup>
                </DrawingBrush.Drawing>
            </DrawingBrush>
        </ResourceDictionary>
    </sap:ActivityDesigner.Resources>
    <ContentPresenter x:Uid="ContentPresenter_1" Style="{DynamicResource DesignerStyle}" Content="{Binding}" />
</sap:ActivityDesigner>
